#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<cstring>
#include<map>
#include<bitset>
#include<set>
using namespace std;
#define LL long long
#define PLL pair<LL,LL>
#define INF 1e18
#define eps 1e-6
#define DB double
#define N 200010
LL n,m;
LL d[N],c[N][3],OP[N];
char a[N];
LL lowbit(LL x)
{
return x & -x;
}
void add(LL l,LL w,LL ty)
{
for(int i=l;i<=n;i+=lowbit(i))c[i][ty]+=w;
}
LL sum(LL l,LL ty)
{
LL ans=0;
for(int i=l;i;i-=lowbit(i))ans+=c[i][ty];
return ans;
}
void check(LL x)
{
if(x<1 || x>n)return ;
LL cnt=0;
add(x,-OP[x],1);
OP[x]=0;
if(x+1<=n)
{
if(sum(x,2)%26==sum(x+1,2)%26)cnt++;
}
if(x+2<=n)
{
if(sum(x,2)%26==sum(x+2,2)%26)cnt++;
}
add(x,cnt,1);
OP[x]=cnt;
}
void solve()
{
cin>>n>>m>>a+1;
for(int i=1;i<=n;i++)
{
c[i][1]=c[i][2]=OP[i]=0;
}
LL ssum=0;
for(int i=1;i<=n;i++)
{
LL tem=a[i]-'a';
tem-=ssum;
add(i,tem,2);
ssum+=tem;
}
for(int i=1;i<=n;i++)check(i);
for(int i=1;i<=m;i++)
{
LL op,l,r,x;
cin>>op>>l>>r;
if(op==1)cin>>x;
if(op==1)
{
add(l,x,2);
add(r+1,-x,2);
check(l-2);check(l-1);
check(r-1);check(r);
}
else
{
LL ans=0;
if(r-2>=l)ans+=sum(r-2,1)-sum(l-1,1);
if(r-1>=l && sum(r-1,2)%26==sum(r,2)%26)ans++;
if(ans==0)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
}
}
int main()
{
//init();
LL t=1;
cin>>t;
while(t--)solve();
return 0;
}
102. Binary Tree Level Order Traversal | 96. Unique Binary Search Trees |
75. Sort Colors | 74. Search a 2D Matrix |
71. Simplify Path | 62. Unique Paths |
50. Pow(x, n) | 43. Multiply Strings |
34. Find First and Last Position of Element in Sorted Array | 33. Search in Rotated Sorted Array |
17. Letter Combinations of a Phone Number | 5. Longest Palindromic Substring |
3. Longest Substring Without Repeating Characters | 1312. Minimum Insertion Steps to Make a String Palindrome |
1092. Shortest Common Supersequence | 1044. Longest Duplicate Substring |
1032. Stream of Characters | 987. Vertical Order Traversal of a Binary Tree |
952. Largest Component Size by Common Factor | 212. Word Search II |
174. Dungeon Game | 127. Word Ladder |
123. Best Time to Buy and Sell Stock III | 85. Maximal Rectangle |
84. Largest Rectangle in Histogram | 60. Permutation Sequence |
42. Trapping Rain Water | 32. Longest Valid Parentheses |
Cutting a material | Bubble Sort |